/*
 * Copyright (C) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef OHOS_I_TELEPHONY_STATE_NOTIFY_H
#define OHOS_I_TELEPHONY_STATE_NOTIFY_H

#include "telephony_observer_broker.h"

namespace OHOS {
namespace TelephonyState {
class ITelephonyStateNotify : public IRemoteBroker {
public:
    enum {
        SIGNAL_INFO = 2,
        NET_WORK_TYPE = 3,
        NET_WORK_STATE = 4,
        CALL_STATE = 5,
        CALL_STATE_FOR_ID = 6,
        ADD_OBSERVER = 7,
        REMOVE_OBSERVER = 8,
    };
    /**
     * UpdateCallState
     *
     * @param callStatus call status
     * @param number call number
     * @return int32_t TELEPHONY_NO_ERROR on success, others on failure.
     */
    virtual int32_t UpdateCallState(int32_t callStatus, const std::u16string &number) = 0;

    /**
     * UpdateCallStateForSlotIndex
     *
     * @param simId sim data id
     * @param slotIndex slot index
     * @param callStatus call status
     * @param number incoming number
     * @return int32_t TELEPHONY_NO_ERROR on success, others on failure.
     */
    virtual int32_t UpdateCallStateForSlotIndex(
        int32_t simId, int32_t slotIndex, int32_t callStatus, const std::u16string &incomingNumber) = 0;

    /**
     * UpdateSignalInfo
     *
     * @param simId sim data id
     * @param slotIndex slot index
     * @param vec networkType search signal information
     * @return int32_t TELEPHONY_NO_ERROR on success, others on failure.
     */
    virtual int32_t UpdateSignalInfo(
        int32_t simId, int32_t slotIndex, const std::vector<sptr<SignalInformation>> &vec) = 0;

    /**
     * UpdateNetworkState
     *
     * @param simId sim data id
     * @param slotIndex slot index
     * @param networkStatus network status
     * @return int32_t TELEPHONY_NO_ERROR on success, others on failure.
     */
    virtual int32_t UpdateNetworkState(
        int32_t simId, int32_t slotIndex, const sptr<NetworkState> &networkState) = 0;

    /**
     * RegisterStateChange
     *
     * @param telephonyObserver api callback
     * @param simId sim data id
     * @param mask  listening type bitmask
     * @param package calling Package
     * @param isUpdate Whether to update immediately
     * @return int32_t TELEPHONY_NO_ERROR on success, others on failure.
     */
    virtual int32_t RegisterStateChange(const sptr<TelephonyObserverBroker> &telephonyObserver, int32_t simId,
        uint32_t mask, const std::u16string &package, bool isUpdate) = 0;

    /**
     * UnregisterStateChange
     *
     * @param simId sim data id
     * @param mask listening type bitmask
     * @return int32_t TELEPHONY_NO_ERROR on success, others on failure.
     */
    virtual int32_t UnregisterStateChange(int32_t simId, uint32_t mask) = 0;

public:
    DECLARE_INTERFACE_DESCRIPTOR(u"ohos.ipc.ITelephonyStateNotify");
};
} // namespace TelephonyState
} // namespace OHOS
#endif // OHOS_I_TELEPHONY_STATE_NOTIFY_H
